package com.example.result.explore

import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.Button
import androidx.compose.material3.Card
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.withStyle

data class ColorInfo(val name: String, val color: Color)

@Composable
fun ColorShow() {
    LazyColumn {
        item {
            Card {
                val colorText = buildAnnotatedString {

                    val colorList =
                        mutableListOf(
                            ColorInfo("primary", MaterialTheme.colorScheme.primary),
                            ColorInfo("onPrimary", MaterialTheme.colorScheme.onPrimary),
                            ColorInfo("surface", MaterialTheme.colorScheme.surface),
                            ColorInfo("onSurface", MaterialTheme.colorScheme.onSurface),
                        )
                    colorList.forEach {
                        withStyle(
                            style = SpanStyle(
                                color = it.color, fontWeight = FontWeight.Bold
                            )
                        ) {
                            append("${it.name}\n")
                        }
                    }
                }
                Text(text = colorText)
            }
        }
        item {
            Text(text = "LocalContentColor")
        }
        item {
            Button(onClick = {}) {
                Text(text = "Button")
                Text(text = "containerColor:primary\ncontentColor:onPrimary\ndisabledContainerColor:onSurface\ndisabledContentColor:onSurface")
            }
        }
        item {
            Surface {
                Text(text = "Surface\ncolor:surface,content:on*")
            }
        }
        item {
            Card {

            }
        }
    }
}